import { defineMock } from "./base";

export default defineMock([
  {
    url: "eventManage/page",
    method: ["GET"],
    body: {
      code: "00000",
      data: {
        list: [
          {
            id: 1,
            repeatNum: 2,
            name: "2024年第八届一带一路暨金砖国家技能发展与技术创新大赛——食品安全快速检测赛项",
            groupName: "高职",
            group: "1",
            paperId: "正式试题A",
            examDate: "2024-12-20 09:30",
            timeLong: 100,
            num: 100,
            status: "0",
            remark: "123",
          },
          {
            id: 2,
            repeatNum: 2,
            name: "2024年第八届一带一路暨金砖国家技能发展与技术创新大赛——食品安全快速检测赛项",
            groupName: "中职",
            group: "2",
            paperId: "正式试题A",
            examDate: "2024-03-12 09:30",
            timeLong: 120,
            num: 500,
            status: "1",
            remark: "123",
          },
          {
            id: 3,
            repeatNum: 1,
            name: "2024年第八届一带一路暨金砖国家技能发展与技术创新大赛——食品安全快速检测赛项",
            groupName: "初职",
            group: "3",
            paperId: "正式试题A001",
            examDate: "2024-06-26 09:30",
            timeLong: 60,
            num: 260,
            status: "2",
            remark: "123",
          },
        ],
      },
      msg: "一切ok",
    },
  },

  // 获取角色表单数据
  {
    url: "examManage/:id/form",
    method: ["GET"],
    body: ({ params }) => {
      return {
        code: "00000",
        data: examMap[params.id],
        msg: "一切ok",
      };
    },
  },

  // 修改竞赛试题
  {
    url: "exam/:id",
    method: ["PUT"],
    body({ body }) {
      return {
        code: "00000",
        data: null,
        msg: "修改竞赛试题" + body.name + "成功",
      };
    },
  },
]);

// 竞赛试题映射表数据
const examMap: Record<string, any> = {
  1: {
    id: 1,
    name: "2024年第八届一带一路暨金砖国家技能发展与技术创新大赛——食品安全快速检测赛项",
    group: "高职",
    paperId: "0",
    examDate: "2024-12-20 09:30",
    timeLong: 100,
    num: 100,
    status: "0",
    remark: "123",
  },
  2: {
    id: 2,
    name: "2024年第八届一带一路暨金砖国家技能发展与技术创新大赛——食品安全快速检测赛项",
    group: "中职",
    paperId: "1",
    examDate: "2024-03-12 09:30",
    timeLong: 120,
    num: 500,
    status: "1",
    remark: "123",
  },
  3: {
    id: 3,
    name: "2024年第八届一带一路暨金砖国家技能发展与技术创新大赛——食品安全快速检测赛项",
    group: "初职",
    paperId: "2",
    examDate: "2024-06-26 09:30",
    timeLong: 60,
    num: 260,
    status: "2",
    remark: "123",
  },
  4: {
    id: 4,
    name: "2024年第八届一带一路暨金砖国家技能发展与技术创新大赛——食品安全快速检测赛项",
    group: "初职",
    paperId: "正式试题B001",
    examDate: "2024-06-26 09:30",
    timeLong: 160,
    num: 260,
    status: "2",
    remark: "123",
  },
};
